#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :Armstrong_20.py
# @Time      :2020/6/22 14:47
# @Author    :Administrator

input_number_min = int(input('请输入区间最小值:'))
input_number_max = int(input('请输入区间最大值:'))

for item in range(input_number_min, input_number_max + 1):
    sums = 0
    for x in str(item):
        sums += int(x) ** len(str(item))
    if sums == item:
        print('{}是阿姆斯特朗数'.format(item))

print('=============================2=======================')
for item in range(input_number_min, input_number_max + 1):
    sums = 0
    item_length = len(str(item))
    temp = item
    while temp > 0:
        digit = temp % 10
        sums += digit**item_length
        temp = temp//10
    if sums == item:
        print('{}是阿姆斯特朗数'.format(item))
